package gui;

import java.io.File;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.swtdesigner.SWTResourceManager;

public class UserProperties extends Dialog {

	protected Object result;
	protected Shell shell;
	private String userProperties;
	/**
	 * Create the dialog
	 * @param parent
	 * @param style
	 */
	public UserProperties(Shell parent, int style, String userProperties) {
		super(parent, style);
		this.userProperties=userProperties;
	}

	/**
	 * Create the dialog
	 * @param parent
	 */
	public UserProperties(Shell parent, String userProperties) {
		this(parent, SWT.NONE, userProperties);
	}

	/**
	 * Open the dialog
	 * @return the result
	 */
	public Object open() {
		createContents();
		shell.open();
		shell.layout();
		Display display = getParent().getDisplay();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		return result;
	}

	/**
	 * Create contents of the dialog
	 */
	protected void createContents() {
		shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
		shell.setLayout(new FillLayout());
		shell.setBackgroundMode(SWT.INHERIT_DEFAULT);
		shell.setBackgroundImage(SWTResourceManager.getImage(UserProperties.class, "/resources/images/mission.png"));
		shell.setImage(SWTResourceManager.getImage(UserProperties.class, "/resources/images/Risk Icon.png"));
		shell.setSize(404, 521);
		shell.setText("User Properties");

		final Composite composite = new Composite(shell, SWT.NONE);
//		Font fontBig = FontLoader.loadFont(
//				shell, 
//				"src" + File.separator + "resources" + File.separator + "fonts" + File.separator + "papyrus.ttf", 
//				15);
		
		final CLabel label = new CLabel(composite, SWT.NONE);
		label.setBackgroundMode(SWT.INHERIT_DEFAULT);
		label.setBounds(48, 92, 310, 331);
		label.setText(userProperties);
//		label.setFont(fontBig);
	}

}
